<style>
#ag-menu{}
#ag-menu .search{border-radius: 5px;background: url(/index/img/zoom.png) no-repeat #A3B2D3 10px 20px;padding:20px 0;}
#ag-menu .search div{width: 190px;margin: 0px 0 0 19px;border: none;border-radius: 5px;margin-left:50px;width:190px;background-color:#fff;border-radius: 5px;}
#ag-menu .search input{background-color: transparent;width:130px;border:none;margin:0;}

#ag-menu .search a{display: inline-block;}

#ag-menu .cate{background-color:#A3B2D3;border-radius: 5px;}
#ag-menu .cate dt{color:#3E336F;margin-top:3px;line-height:43px;letter-spacing: 10px;background:url(/weixin/img/menu-off.png) no-repeat 210px;cursor: pointer;border-radius: 5px;padding:0 40px;font-size: 20px;font-weight: bold;}
#ag-menu .cate dt.menuon{background:url(/weixin/img/menu-on.png) no-repeat 210px;}
#ag-menu .cate dd{display:none;margin-right:50px;}
#ag-menu .cate dd a{line-height:37px;display:block;text-align:right;color:#fff;letter-spacing: 10px;font-size:18px;}
#ag-menu .cate dd .current{margin-left:8px;width:194px;padding-right:60px;background:url(/skin/img/cate-current.png);}
</style>
<script>
function closeAll(){
	$(".fcate dd").hide();
	$(".fcate dt").removeClass('menuon');
}
function showCurrent(){
	$("#ag-menu .current").parent().show('slow');
	$("#ag-menu .current").parent().parent().find('dt').addClass('menuon');
}
function showClick(obj){
	$(obj).siblings("dd").show('slow');
	$(obj).addClass('menuon');
}
$(document).ready(function(){
	showCurrent();
	$(".fcate dt").click(function(){
		closeAll();
		//showCurrent();
		showClick(this);
	});
});

</script>

<div id="ag-menu">
	<div class="search">
		<form action="<?=n_url('mprank','search')?>">
			<div>
				<input type="text" name="group" placeholder="请输入搜索内容" />
				<a href="javascript:void(0);" onclick="$(this).parent().parent().submit();"><img src="/index/img/play.png" /></a>
			</div>
		</form>
	</div>

	<div class="cate">
		<?php
		foreach($data['index'] as $key=>$val){
			foreach($val as $key1=>$val1){
				$cinfo = $data['cateTree'][$key1];
			?>
				<dl class="fcate a-split">
					<dt>
						<?=$key1?>
						</dt>
					<dd>
						<?php
						foreach($cinfo as $key2=>$val2){
							?>
							<a href="?cid=<?=$val2['id']?>" class="<?=$val2['id']==$data['current']?'current':''?>"><?=$val2['second_category']?></a>
							<?php
						}
						?>
					</dd>
				</dl>
			<?php
		}
		}
		?>
	</div>
</div>
